home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 3
/
Aminet 3 - July 1994.iso
/
Aminet
/
mus
/
misc
/
copyist.lha
/
c2txt.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-10
|
565b
|
31 lines
#include "vd0:stdio.h"
main(argc,argv)
int argc;
char *argv[];
{
FILE *fpin,*fpout;
unsigned short x,y,z;
int total,xpos,ypos;
if((fpin=fopen(argv[1],"rb"))==0) {
printf("Cannot open file %s\n",argv[1]);
exit(1);
}
if((fpout=fopen(argv[2],"w"))==0) {
printf("Cannot open file %s\n",argv[2]);
exit(1);
}
while ((x = fgetc(fpin)) != 255) {
y = fgetc(fpin);
z = fgetc(fpin);
total = ((x * 256 + y) - 3200);
ypos = (total / 160) + 1;
xpos = 161 + (total - (ypos * 160));
fprintf(fpout,"%3d %3d %3d\n",xpos,ypos,z);
}
fclose(fpin);
fclose(fpout);
}